<template>
    <div class="page-container">

        <el-tabs v-model="activeName" class="demo-tabs">
            <el-tab-pane label="订单统计" name="first">
                <el-form :inline="true" :model="form" class="demo-form-inline">
                    <el-form-item label="Time range">
                        <el-date-picker class="rangePicker" format="YYYY-MM-DD" v-model="form.timeRange" type="daterange" range-separator="To" start-placeholder="Start date" end-placeholder="End date" />
                    </el-form-item>
                    <el-form-item style="margin-right: 0;">
                        <el-button type="primary" size="small" @click="onSubmit">Query</el-button>
                        <el-button type="warning" size="small" @click="onReset">Reset</el-button>
                    </el-form-item>
                </el-form>
                <div class="tj-items">
                    <div class="tj-item">
                        <div>订量数量</div>
                        <div>100</div>
                    </div>
                    <div class="tj-item">
                        <div>订量金额</div>
                        <div>100</div>
                    </div>
                    <div class="tj-item">
                        <div>订量配送费</div>
                        <div>100</div>
                    </div>
                    <div class="tj-item">
                        <div>下单用时(Avg)</div>
                        <div>100</div>
                    </div>
                </div>
                <div class="divider"></div>
                <Ddtj />
            </el-tab-pane>
            <el-tab-pane label="菜品统计" name="second">
                <el-form :inline="true" :model="form" class="demo-form-inline">
                    <el-form-item label="Time range">
                        <el-date-picker class="rangePicker" format="YYYY-MM-DD" v-model="form.timeRange" type="daterange" range-separator="To" start-placeholder="Start date" end-placeholder="End date" />
                    </el-form-item>
                    <el-form-item style="margin-right: 0;">
                        <el-button type="primary" size="small" @click="onSubmit">Query</el-button>
                        <el-button type="warning" size="small" @click="onReset">Reset</el-button>
                    </el-form-item>
                </el-form>
                <CpTj />
            </el-tab-pane>
            <el-tab-pane label="用户统计" name="third">
                <el-form :inline="true" :model="form" class="demo-form-inline">
                    <el-form-item label="Time range">
                        <el-date-picker class="rangePicker" format="YYYY-MM-DD" v-model="form.timeRange" type="daterange" range-separator="To" start-placeholder="Start date" end-placeholder="End date" />
                    </el-form-item>
                    <el-form-item style="margin-right: 0;">
                        <el-button type="primary" size="small" @click="onSubmit">Query</el-button>
                        <el-button type="warning" size="small" @click="onReset">Reset</el-button>
                    </el-form-item>
                </el-form>
                <UserTj />
            </el-tab-pane>
        </el-tabs>
    </div>
</template>
<script setup>
import { reactive } from 'vue';
import { ref } from 'vue'
import Ddtj from './dd-tj.vue'
import CpTj from './cp-tj.vue'
import UserTj from './yh-tj.vue'
const activeName = ref('first')
const form = reactive({
    timerange: [],
})
const onSubmit = () => { }
const onReset = () => { }
</script>
<style lang="scss" scoped>
.demo-form-inline {
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
    text-align: right;

    .el-form-item {
        margin-right: 10px;
    }
}

.demo-form-inline .rangePicker .el-range-input {
    width: 100px;

}

.demo-form-inline {
    :deep(.el-input__wrapper) {
        width: auto;

        .el-range-input {
            width: 120px;
        }
    }
}

.demo-form-inline .el-input {
    --el-input-width: 150px;
}

.demo-form-inline .el-select {
    --el-select-width: 150px;
}

.tj-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);

    .tj-item {
        padding: 10px;
        background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
        border-radius: 12px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;

        &:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);

            &::after {
                transform: translateX(0);
            }
        }

        &::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 3px;
            background: var(--el-color-primary);
            transform: translateX(-100%);
            transition: transform 0.3s ease;
        }

        div:first-child {
            color: #606266;
            font-size: 14px;
            margin-bottom: 12px;
        }

        div:last-child {
            color: var(--el-color-primary);
            font-size: 28px;
            font-weight: 600;
            letter-spacing: 1px;
            position: relative;
            padding-left: 24px;

            &::before {
                content: '✦';
                position: absolute;
                left: 0;
                top: 50%;
                transform: translateY(-50%);
                color: rgba(var(--el-color-primary-rgb), 0.2);
                font-size: 20px;
            }
        }
    }
}

.divider {
    border-bottom: 1px solid #eee;
    margin: 10px 0;
    margin-top: 0px;
}
</style>